﻿using System.Collections.Generic;
using HiTeachers.Data.Manager;
using HiTeachers.Entities;
using HiTeachers.Interfaces;

namespace HiTeachers.Data
{
    public class SubjectDao : AbstractNHibernateDao<Subject, short>, ISubjectDao
    {
        public IList<Subject> GetSubjects(string subjectIds)
        {
            const string hsql = "from Subject s where s.ID in (:subjectIds)";

            var query = NHibernateSession.CreateQuery(hsql);
            query.SetParameterList("subjectIds", subjectIds.Split(','));

            return query.List<Subject>();
        }
    }
}
